package com.haojii.twittertranslate;
import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class StatusServlet extends HttpServlet {
	private static final Logger log = Logger.getLogger(StatusServlet.class.getName());
	
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		resp.setContentType("text/plain");
		resp.setCharacterEncoding("UTF-8");
		
		long l = 1L;
		while (StatusEntityUtils.checkIfExist(l))
		{
			log.info(l+" exist");
			l++;
		}
		StatusEntityUtils.save(l, "Hello"+l);
		
		resp.getWriter().println(l + "saved");
	}
}
